<div class="boxid">
    <div class="tieude">
        Thông báo mới         
    </div>

    <div class="data">
        <div class="text">

    <?php
        if($_SESSION['vaitro']=="Quản Trị"){
            $linktb1 = "../admin/thongbao.php";
            $linktb2 = "../admin/hienthi_thongbao.php?id=";
        }else{
            $linktb1 = "../view/thongbao.php";
            $linktb2 = "../view/hienthi_thongbao.php?id=";            
        }
        
        $sql = "SELECT TieuDe,left(NoiDung,100)as NoiDung FROM thongbao WHERE NgayDang = ( SELECT MAX( NgayDang ) FROM thongbao ) ";
        $news = executeQuery($sql);
        while($row = mysql_fetch_array($news)){
            $tieude = $row['TieuDe'];
            $noidung = $row['NoiDung'];
            
            echo "<h4>$tieude</h4>";
            echo "<p>$noidung</P>";
        }
    ?>
        </div>
        <a href="<?php echo $linktb1; ?>" >xem tiếp</a><br />
        <hr />

            <?php
        $sql = "SELECT * FROM  `thongbao` ORDER BY  `thongbao`.`NgayDang` DESC LIMIT 0 , 4 ";
        $news = executeQuery($sql);
        while($row = mysql_fetch_array($news)){
            $tieude = $row['TieuDe'];
            $idthongbao = $row['id'];
            
            echo "<a href='$linktb2 $idthongbao'>$tieude</a>";

        }
    ?>
    </div>

</div>